package com.example.mytestdemo.customviewbook.four.sliding.harvic.slidingconflict.testtouchevent;

import android.content.Intent;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnClickListener;

import androidx.appcompat.app.AppCompatActivity;

import com.example.mytestdemo.R;

public class FourMainActivity extends AppCompatActivity implements OnClickListener{

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_four_main);

        findViewById(R.id.second_activity).setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        int id = v.getId();
        switch (id){
        case R.id.second_activity:{
            startActivity(new Intent(FourMainActivity.this,SecondActivity.class));

        }
        break;
        }
    }

    @Override
    public boolean dispatchTouchEvent(MotionEvent event) {
        LogHelper.onLog("MainActivity dispatchTouchEvent",event);
        return super.dispatchTouchEvent(event);
//        return true;
    }

    @Override
    public boolean onTouchEvent(MotionEvent event) {
        LogHelper.onLog("MainActivity onTouchEvent",event);
        return true;
    }
}
